from django.contrib import admin
from django.urls import path, include, re_path
from django.views.static import serve

from djangoProject.settings import MEDIA_ROOT, STATIC_ROOT
from myapp import views

urlpatterns = [
re_path('media/(?P<path>.*)', serve, {'document_root': MEDIA_ROOT}),  # 匹配media目录下的文件
    re_path('static/(?P<path>.*)', serve, {'document_root': STATIC_ROOT}),  # 匹配static目录下的文件
    path('admin/', admin.site.urls),
    path('index/', views.index, name='index'),  # 定义路由
    path('', include('myapp.urls')),  # 包含myapp的urls.py文件
    path('', include('myapp2.urls')),  # 包含myapp2的urls.py文件
    path('', include('myapp3.urls')),  # 包含myapp3的urls.py文件
    path('', include('myapp4.urls')),  # 包含myapp4的urls.py文件
    path('', include('myapp5.urls')),  # 包含myapp5的urls.py文件
    path('', include('myapp6.urls')),  # 包含myapp6的urls.py文件
    path('', include('myapp7.urls')),  # 包含myapp7的urls.py文件
    path('', include('myapp8.urls')),  # 包含myapp8的urls.py文件
    path('', include('myapp9.urls')),  # 包含myapp9的urls.py文件
    path('', include('myapp10.urls')),  # 包含myapp10的urls.py文件
]
